package com.aspose.cells;

class zawy extends zawu {
   private zaik c;
   private boolean d;

   public zawy(zahn var1, zaik var2, zaay var3) {
      super(var1, var3);
      this.c = var2;
   }

   public zahn b(zaay var1) {
      zahn var2 = this.a.b(var1);
      return new zawy(var2, this.c.a(var2), var1);
   }

   public int b() {
      return this.a.b();
   }

   public zagu a(int var1, int var2) {
      zagu var3 = this.c.c(var1, var2);
      if (var3 != null) {
         return var3;
      } else {
         var3 = this.a.a(var1, var2);
         if (var3.b(this.b, false) == 3) {
            var3 = var3.e(this.b);
         } else {
            if (!this.a.z()) {
               var3 = var3.i();
            }

            var3.a(false);
         }

         this.c.a(var1, var2, var3);
         return var3;
      }
   }

   public void f() {
      this.c.a();
      this.a.f();
      this.d = false;
   }

   public boolean b(int var1, int var2) {
      if (this.c.a(var1, var2)) {
         if (this.c.c() != null) {
            this.d = true;
            return true;
         }

         if (this.a.b(var1, var2)) {
            this.c.b(this.a.i(), this.a.j());
            this.d = false;
            return true;
         }

         this.c.g();
      }

      return false;
   }

   public boolean a(int var1) {
      if (this.c.a(var1)) {
         if (this.c.c() != null) {
            this.d = true;
            return true;
         }

         if (this.a.a(var1)) {
            this.c.d(this.a.k());
            this.d = false;
            return true;
         }

         this.c.g();
      }

      return false;
   }

   public boolean g() {
      if (this.c.b()) {
         if (this.c.c() != null) {
            this.d = true;
            return true;
         }

         if (this.d) {
            if (this.a.b(this.c.d(), this.c.e())) {
               this.c.b(this.a.i(), this.a.j());
               this.d = false;
               return true;
            }
         } else if (this.a.g()) {
            int var1 = this.a.i();
            int var2 = this.a.j();
            if (var1 == this.c.d()) {
               if (var2 >= this.c.e()) {
                  if (var2 > this.c.e()) {
                     this.c.b(var1, var2);
                  }

                  return true;
               }

               if (this.a.b(this.c.d(), this.c.e())) {
                  this.c.b(this.a.i(), this.a.j());
                  return true;
               }
            } else {
               if (var1 >= this.c.d()) {
                  this.c.b(var1, var2);
                  return true;
               }

               if (this.a.b(this.c.d(), this.c.e())) {
                  this.c.b(this.a.i(), this.a.j());
                  return true;
               }
            }
         }

         this.c.g();
      }

      return false;
   }

   public zagu h() {
      if (this.c.c() == null) {
         zagu var1 = this.a.h();
         if (var1.b(this.b, false) == 3) {
            var1 = var1.e(this.b);
         } else {
            if (!this.a.z()) {
               var1 = var1.i();
            }

            var1.a(false);
         }

         this.c.a(var1);
      }

      return this.c.c();
   }

   public int i() {
      return this.c.d();
   }

   public int j() {
      return this.c.e();
   }

   public int k() {
      return this.c.f();
   }

   public zahn b(int var1) {
      if (this.a.m()) {
         return this;
      } else {
         return (zahn)(this.a.n() ? new zaya(this.a(var1, 0)) : new zawy(this.a.b(var1), this.c.b(var1), this.b));
      }
   }

   public zahn c(int var1) {
      if (this.a.n()) {
         return this;
      } else {
         return (zahn)(this.a.m() ? new zaya(this.a(0, var1)) : new zawy(this.a.c(var1), this.c.c(var1), this.b));
      }
   }

   public zahn c(zaay var1) {
      zahn var2 = this.c.a(var1, this.a.b());
      if (var2 != null) {
         var2.a(true);
         return var2;
      } else {
         return this;
      }
   }

   public boolean z() {
      return this.a.z();
   }

   public void b(boolean var1) {
      this.a.b(var1);
   }

   public void a(zaay var1) {
      super.a(var1);
      this.c.a(this.b);
   }
}
